package cn.tedu.classx;

public class StudentDemo {
    public static void main(String[] args) {
        //创建Student类的对象
//        Student s1 = new Student();
//        //对象的属性赋值
//        s1.name = "张三";
//        s1.age = 19;
//        s1.sid = 1;
//        //调用学生的学习的方法
//        s1.study();
//        System.out.println(s1.sid+","+s1.name+","+s1.age);

        //创建Student对象
//        Student s2 = new Student();
//        System.out.println(s2.age);//18
//        Student s3 = new Student();
//        s3.age = 20;
//        System.out.println(s3.age);//18

        //创建对象确实要调用无参构造
//        Student s4 = new Student(4,"lisi",22);
//        System.out.println(s4.name);//"lisi"
//        Student s5 = new Student(5,"wangwu",19);
//        System.out.println(s5.name);//"wangwu"
//
//        Student s6 = new Student();
//        s6.name = "小小";
//        s6.study();

        //通过两个参数的构造方法来创建对象
//        Student s7 = new Student("小白",19);

        //调用method方法
        //创建Student对象
        Student stu = new Student(1,"aa",16);
        Student stu1 = new Student(2,"bb",18);
        Student stu2 = stu.method(stu1);
        System.out.println(stu);//28d93b30
        System.out.println(stu1);//1b6d3586
        System.out.println(stu2);//1b6d3586
        System.out.println(stu.name);//aa
        System.out.println(stu1.name);//丽丽
        System.out.println(stu2.name);//丽丽

        stu.play();
    }
}
